<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                >
    <xsl:template match="/">
        <html>
            <head>
                <link rel="stylesheet" type="text/css" href="../css/style.css"/>
            </head>

            <body>
                <h2>List of categories: </h2>
                <div class="blockCenter">
                    <ul><xsl:apply-templates/></ul>
                </div>
            </body>
        </html>
    </xsl:template>
    <xsl:template match="category">
        <xsl:variable name="nam" select="@name"/>
        <xsl:variable name="count" select="count(//category[@name = $nam]/subcategory)"/>
        <li>
            <a href="/servlet?command=show&amp;category={@name}&amp;type=subcategoryList">
                <xsl:value-of select="$nam"/>(<xsl:value-of select="$count"/>)
            </a>
        </li>
    </xsl:template>
</xsl:stylesheet>